// pages/member/member.js
const app = getApp();
var ea = require('../../utils/each.js');
var WxParse = require('../../utils/wxParse/wxParse.js');

Page({

  /**
   * 页面的初始数据
   */
  data: {
    indexdd: 3,
    imgs: app.data.imgurl + "menberxq.png",
    imd: app.data.imgurl + "imd.png",
    imgtypes: ["联盟简介", "规章制度", "领导机构", "组织机构"],
    rightarrow: app.data.imgurl + "rightarrow.png",
    memberpersonal: app.data.imgurl + "member1.png",
    membergroup: app.data.imgurl + "member2.png",
    headsrc: app.data.imgurl + "menberxq.png",
    address: app.data.imgurl + "address.png",
    names: ["李红", "王玉贵", "张旺才", "李红", "王玉贵", "张旺才", "李红", "王玉贵", "张旺才","张育才"],
    jiguan: ["办公室", "机关党委办公室", "会员工作室","对外联络处"],
    getzuzhi: app.data.url + 'sheyingjia/Xzuzhi1/getzuzhi',
    shuju:{}
  },
  //点击导航栏
  ssx: function (e) {
    // console.log(e)
    var indexdd = e.currentTarget.dataset.index;
    this.setData({
      indexdd: indexdd
    })
  },
  //个人入会资料
  topersonal: function () {
    wx.navigateTo({
      url: '/pages/xqmemberpersonal/xqmemberpersonal',
    })
  },
  //团体入会资料
  togroup: function () {
    wx.navigateTo({
      url: '/pages/xqmembergroup/xqmembergroup',
    })
  },



  //个人入会申请   或者缴费  如果这个人已经申请成功 跳转下面那个链接
  topersonals: function () {
    wx.navigateTo({
      url: '/pages/memberdownload/memberdownload',
    })
  },

  //团体入会申请 或者缴费  如果这个人已经申请成功 跳转下面那个链接
  togroups: function () {
    wx.navigateTo({
      url: '/pages/memberdownloadgroup/memberdownloadgroup',
    })
  },
  // 个人缴费
  topersonalss: function () {
    wx.navigateTo({
      url: '/pages/topersonalinto/topersonalinto',
    })
  },
  //团体缴费
  togroupss: function () {
    wx.navigateTo({
      url: '/pages/togroupinto/togroupinto',
    })

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    ea.request(that.data.getzuzhi,{},function(res){
      var data = res.data;
      if(data.code==200){
        console.log(data.data);
        WxParse.wxParse('jianjie', 'html', data.data.jianjie.data.dir, that, 25);
        WxParse.wxParse('guizhang', 'html', data.data.guizhang.data.neirong, that, 25);
        WxParse.wxParse('lindao', 'html', data.data.lindao.data.jianjie, that, 25);
        that.setData({shuju:data.data});
      }else{
        wx.showToast({
          title: data.msg,
          icon:'none'
        })
      }
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})